) and non-inverse (4-7bit ).
6,Data Block(Block 0, Block 1, Block 2) access control is as follows:
Control bit (x = 0 .. 2)
Access items (0, 1, and 2 for data blocks)
C1x
C2x
C3x
Read
Write
Increment
Decrement, transfer,Restore
0
0
0
Keya | B
Keya | B
Keya | B
Keya | B
0
1
0
Keya | B
Never
Never
Never
1
0
0
Keya | B
Keyb
Never
Never
are identical, the encryption results will be different each time, increasing the difficulty of cracking.// The larger the value, the larger the ciphertext change law. The ciphertext change is equal to the power of $ ckey_length of 16.// When this value is 0, no random key is generated$ Key = md5 ($ key? $ Key: CT_KEY); // If $ key is not given, use the global variable CT_KEY.$ Keya = md5 (substr ($ key, 0, 16); // The first half of the key is md5 again, $ keya = 32-byte long string$
different from that of the php version. $ String is the same before this code is run, but it won't be able to be used after it is run.
Code:
Function authcode (str, operation, key, expiry) {var operation = operation? Operation: 'decode'; var key = key? Key: ''; var expiry = expiry? Expiry: 0; var ckey_length = 4; key = md5 (key); // key a is used for encryption and decryption. var keya = md5 (key. substr (0, 16); // key B is used for data integrity verification var
Encryption keypublic string Encryptkey{Get{return This.key;}Set{This.key=value;}}Encoding mode to encrypt charactersPublic Encoding Encodingmode{Get{return this.encoding;}Set{this.encoding=value;}}#endregion#region "Methods"Encrypts the string and returns the result of the encryptionpublic string encryptstring (String str){Byte[] Ivb=encoding.ascii.getbytes (THIS.IV);Byte[] Keyb=encoding.ascii.getbytes (this. Encryptkey);/Get Encryption KeyByte[] Toe
DESCryptoServiceProvider ();}"Propertys" #region "Propertys"/**////Set Encryption keypublic string Encryptkey{Get{return This.key;}Set{This.key=value;}}/**////Encoding mode to encrypt charactersPublic Encoding Encodingmode{Get{return this.encoding;}Set{this.encoding=value;}}#endregion"Methods" #region "Methods"/**////Encrypts the string and returns the result of the encryptionpublic string encryptstring (String str){Byte[] Ivb=encoding.ascii.getbytes (THIS.IV);Byte[]
same before the code was run, but it didn't work.
Attached code:
function Authcode (str, operation, key, expiry) {var operation = operation? Operation: ' DECODE '; var key = key? Key: '; var expiry = expiry? Expiry:0;var ckey_length = 4;key = MD5 (key);//Key A will participate in the decryption var Keya = MD5 (KEY.SUBSTR (0, 16));//key B will be used for data integrity verification var keyb = MD 5 (KEY.SUBSTR (16, 16));//key C is used to change
Vs2005! However, if you use a key to encrypt text, numbers, and dates at the same time, it may be a bit of trouble! I just wrote a simple one and tested it! Still usable! Haha!
The Code is as follows:
Public class myencrytppassstring'Self-compiled simple encryption and decryption text string class'1. Keys: two. Define a key type: stringkeytype, which has two member types: Keya and keyb, and a public encryption string publicstr.'II. encryption:① Gener
are different. for details, refer!The java method is described as follows:1. convert the key and source string into byte arrays respectively.2. declare two 64-bit arrays to fill the byte array of the key with an exclusive or operation, and add 54 and 92 to fill the 64-bit length respectively.3. get the MessageDigest object of the md5 digest algorithm4. update the MessageDigest Digest using an array and an array of the source string to complete hash calculation.5. reset the summary6. use another
(); Send the data that is no longer cached to the browser}else{Unset ($urlexp [$j]);}}}return $urlall; Return to this page to search for the resulting array}function memory ($collection _url, $i){Global $temp _file;if (Is_array ($collection _url)){for ($h =0; $h {For ($l =0 $l {$strts. = $collection _url[$h] [$l]. " \ n ";}}$wstr =file_get_contents ($temp _file);File_put_contents ($temp _file, $wstr. $strts);if ($i ==0){$i = 2;}$k = $i-1;echo " ";Exit}}function Memorys ()//primarily generates f
($key, 0, 16));
Key B is used for data integrity verification.
$KEYB = MD5 (substr ($key, 16, 16));
Key C used to change the generated ciphertext
$KEYC = $ckey _length? ($operation = = ' DECODE ' substr ($string, 0, $ckey _length):
SUBSTR (MD5 (Microtime ()),-$ckey _length)): ';
Keys for participating operations
$cryptkey = $keya. MD5 ($keya. $KEYC);
$key _length = strlen ($cryptkey);
PlainText, the first 10 bits are used to hold the timesta
($key, 0, 16));
Key B is used for data integrity verification.
$KEYB = MD5 (substr ($key, 16, 16));
Key C used to change the generated ciphertext
$KEYC = $ckey _length? ($operation = = ' DECODE ' substr ($string, 0, $ckey _length): substr (MD5 (Microtime ()),-$ckey _length)): ";
Keys for participating operations
$cryptkey = $keya. MD5 ($keya. $KEYC);
$key _length = strlen ($cryptkey);
PlainText, the first 10 bits are used to hold the timestam
in the current directory, and I can include any php files. what kind of spark can be found when I combine the two files?
Guess the source code of download. phpDownload. php
#! Php
Admin. php (this is downloaded later. paste it directly ..)
#!php
In this case, we only need to include download. php to change the directory restriction ~ Final payload
#!htmlhttp://url/admin.php?m=../file/downloadf=admin.php
You can see that the download is complete ..
Later, I gave hint3 and downloaded flag
will participate in encryption and decryption [KEYA = MD5 new key Top 16] - $keyb=MD5(substr($key, 16, 16));//key B will be used for data integrity verification [KEYB = MD5 new key after 16 bits] in //Key C for ciphertext generated by change - //encryption: KEYC = Current time milliseconds do MD5 encryption, intercept end random key length character to //decryption: KEYC = intercepts the string at
javaphp encryption MD5
Continue to help the second wave, the great God can this Java MD5 method to write a PHP version, the encryption results consistent, thank you, the first wave has a talent to write a, but the encryption results are not the same, we can refer to the next!The Java method describes the following ideas1. Convert the secret key, source string, respectively, to byte array2. Declare 2 64-bit arrays to fill in the byte array of key, respectively, and add 54, 92 to fill 64 leng
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.